import { createRouter, createWebHashHistory } from 'vue-router'


const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/home',
      component: () => import('@/views/Home.vue')
    },
    {
      path: '/',
      redirect: '/home'
    },
    //登录
    {
      path: '/login',
      component: () => import('@/views/Login.vue')
    },
    //商品详情
    {
      path: '/goodsdetail',
      component: () => import('@/views/GoodsDetail.vue'),
    },
    //商品评价
    {
      path: '/goodsreview',  
      component: () => import('@/components/goodsdetail/GoodsReview.vue')
    },
    //注册
    {
      path: '/reg',
      component: () => import('@/views/Reg.vue')
    },
    //商品信息
    {
      path: '/goods',
      component: () => import('@/views/Goods.vue')
    },
    //购物车
    {
      path: '/cart',
      component: () => import('@/views/Cart.vue')
    },
    //订单结算
    {
      path: '/cal',
      component: () => import('@/views/Cal.vue')
    },
    //我的订单
    {
      path: '/order',
      component: () => import('@/views/MyOrder.vue')
    },
    //晒单
    {
      path:'/shaidan',
      component: () => import('@/views/Shaidan.vue')
    },
    //个人中心
    {
      path: '/portal',
      component: () => import('@/views/Portal.vue')
    },
    //账号
    {
      path:'/zhanghao',
      component: () => import('@/views/Zhanghao.vue')
    },
   //后台首页
    {
      path: '/admin',
      component: () => import('@/views/admin/adminHome.vue'),
    },
    {
      path: '/adminlunbo',
      component: () => import('@/views/admin/adminLunbo.vue')
    },
    //商品信息
    {
      path: '/admingoods',
      component: () => import('@/views/admin/adminGoods.vue')
    },
    //回复评论
    {
      path: '/adminreviews',
      component: () => import('@/views/admin/adminReviews.vue')
    },
    //用户
    {
      path: '/adminusers',
      component: () => import('@/views/admin/adminUsers.vue')
    },
    //订单
    {
      path: '/adminorder',
      component: () => import('@/views/admin/adminOrders.vue')
    },
    {
      path: '/adminshortcut',
      component: () => import('@/views/admin/adminShortCut.vue')
    },

  ]
})

export default router
